package com.springboot;

import com.springboot.redis.RedisApplication;
import com.springboot.redis.bean.Student;
import com.springboot.redis.service.StudentService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * @author peter
 * @title: ApplicationTest
 * @projectName springAll-peter
 * @description: TODO
 * @date 19-6-3下午12:22
 */
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = RedisApplication.class)
public class ApplicationTest {

    @Autowired
    private StudentService studentService;

    @Test
    public void test1() throws Exception {
        Student student1 = this.studentService.queryStudentBySno(1);
        System.out.println("学号" + student1.getSno() + "的学生姓名为：" + student1.getName());

        Student student2 = this.studentService.queryStudentBySno(1);
        System.out.println("学号" + student2.getSno() + "的学生姓名为：" + student2.getName());
    }




}
